#/usr/bin/env python
# -*- coding: utf8 -*-
# title       :
# description :
# author      :'ShenMeng'

import maya.cmds as cmds
import pymel.core as pmel

class Validation(object):
    name = u'Lights | 灯光检查'
    dataDict = dict()
    lightTypeList = [ "light",
                      "RedshiftPhysicalLight",
                      "RedshiftIESLight",
                      "RedshiftPortalLight",
                      "RedshiftDomeLight",
                      "RedshiftPhysicalSun"]

    def execute(self):
        self.dataDict = {}
        lightList = pmel.ls(type=self.lightTypeList)
        if lightList:
            for light in lightList:
                lightParent = light.getParent().longName()
                self.dataDict[lightParent] = []
        return self.dataDict

    def correct(self):
        for light, _ in self.dataDict.items():
            cmds.delete(light)

    def search(self, obj):
        cmds.select(obj)